% V20210224 - 8.1 GW_ADD_AUDIO INCLUDE "GW.bas" % Create a page. p = GW_NEW_PAGE() % Prepare title bar string. Title$ = GW_ADD_BAR_TITLE$("Audio Example") % Add title to page. GW_ADD_TITLEBAR(p, Title$) % String that holds a caption. t$ = "This AUDIO control plays " % Add descriptive text. mytext = GW_ADD_TEXT(p, t$ + "boing.mp3") % Now add the audio control. myaudio = GW_ADD_AUDIO(p, "boing.mp3") % Add a button to change audio file. GW_ADD_BUTTON(p, "Change audio to whee.mp3", "whee") % Add another button to change audio file. GW_ADD_BUTTON(p, "Change audio to boing.mp3", "boing") % Now show the page. GW_RENDER(p) DO % Wait for user action. r$ = GW_WAIT_ACTION$() IF r$ = "whee" THEN GW_MODIFY(myaudio, "content", "whee.mp3") GW_MODIFY(mytext, "text", t$ + "whee.mp3") ENDIF IF r$ = "boing" THEN GW_MODIFY(myaudio, "content", "boing.mp3") GW_MODIFY(mytext, "text", t$ + "boing.mp3") ENDIF % End when BACK key is pressed. UNTIL r$ = "BACK" END "End of Audio example."